home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 40
/
Vol 40.iso
/
games
/
water_ba.swf
/
scripts
/
frame_7
/
DoAction.as
< prev
Wrap
Text File
|
2007-03-20
|
64KB
|
2,334 lines
function ladybug()
{
}
function bird()
{
}
function superz()
{
}
function powerup()
{
}
function tree_class()
{
}
function boards()
{
}
function balloon()
{
}
function star()
{
}
function scrollblock()
{
}
function launchbeez()
{
if(!_root.hivez)
{
beeenter.singleshot("beeenter",true);
hivearray = [[100,160,320,270,155,450,30,180],[310,200,250,100,230,230,220,120,310]];
base.attachMovie("hive","hive",11,{_x:hivearray[0][random(8)],_y:hivearray[1][random(8)]});
_root.hivez = true;
}
}
function ladybug()
{
ladyin.singleshot("ladyin",true);
bugarray = [[10,30,50,70,16,60,30,10],[310,230,320,100,230,230,220,120,310]];
base.attachMovie("ladybug","ladybug",14,{_x:bugarray[0][random(8)],_y:bugarray[1][random(8)]});
}
function dropsome()
{
_root.pupint = setInterval(function()
{
if(_root.pickedup == true and _root.powerupadded < _root.p_total)
{
_root.powerupadded = _root.powerupadded + 1;
_root.p_num = random(_root.p_array.length);
mypoZ = random(8);
pupitup.singleshot("pupitup",true);
powerup = base.attachMovie("Pup_holder","powerup",9200,{_x:_root.base.poweruparray[0][mypoZ],_y:_root.base.poweruparray[1][mypoZ],i:0});
base.attachMovie("fountain","fountainz",9800,{_x:base.powerup._x,_y:base.powerup._y - 100});
powerup.gotoAndStop(_root.p_array[_root.p_num]);
_root.pickedup = false;
clearInterval(_root.pupint);
}
}
,15000);
}
function dropsuper()
{
_root.supint = setInterval(function()
{
mypoZz = random(2);
myrandz = random(2);
switch(myrandz)
{
case 0:
base.attachMovie("super1","superp",63,{_x:_root.base.superarray[0][mypoZz],_y:_root.base.superarray[1][mypoZz],i:0});
break;
case 1:
base.attachMovie("super_2","superp",62,{_x:_root.base.superarray[0][mypoZz],_y:_root.base.superarray[1][mypoZz],i:0,tag:2});
break;
case 2:
base.attachMovie("super_1","superp",62,{_x:_root.base.superarray[0][mypoZz],_y:_root.base.superarray[1][mypoZz],i:0,tag:2});
}
superup.singleshot("super_up",true);
clearInterval(_root.supint);
}
,25000);
}
function character()
{
}
function drop()
{
if(!this.dropfence)
{
gozz.singleshot("gozz",true);
_root.base.enemy1.shutdown = true;
_root.base.enemy3.shutdown = true;
arrowz = base.attachMovie("arrow_out","arrow",320,{_x:500,_y:40});
arrowz.onEnterFrame = function()
{
_root.base.shakeit();
this.arrowdrive(30,10,10,15,10);
};
fence2.singleshot("fenceopen",true);
base.grass.gotoAndStop(2);
base.fence.gotoAndStop(2);
base.hitsite.removeMovieClip();
}
this.dropfence = true;
}
function opponent()
{
this.tosscount = 0;
this.shutdown = false;
this.bhit = false;
}
function attach()
{
_root.ammotype = 2;
}
function gametime(onoff)
{
if(onoff == 1)
{
time = setInterval(function()
{
_root.fullsecond += 1;
mainui.ui.timeicon.nextFrame();
if(!timeinit)
{
_root.minute = 0;
_root.sec = 0;
timeinit = true;
}
_root.z = _root.z + 1;
if(_root.z < 1)
{
_root.sec = "00";
}
if(_root.z < 10 and _root.z >= 1)
{
_root.sec = ["0" + _root.z];
}
if(_root.z >= 10)
{
_root.sec = _root.z;
}
if(_root.sec > 59)
{
_root.sec = "00";
_root.z = 0;
_root.minute = _root.minute + 1;
}
}
,1000);
}
if(onoff == 2)
{
clearInterval(time);
_root.z = 0;
}
}
function compile_score()
{
myDate = new Date();
myDate2 = new Date();
_root.storedtime = myDate.getTime(1);
_root.storedtime2 = myDate2.getTime(2);
_root.bonus += _root.critterhit;
if(_root.fullsecond < 90)
{
_root.bonus += 20;
}
_root.yourhits = _root.chartag;
_root.hittally = _root.uitext1 + _root.uitext2 - _root.yoursplash;
_root.score = _root.prevscore + _root.hittally + _root.bonus + _root.addscore;
_root.storedtime = _root.storedtime;
_root.inputext = _root.score;
loglocalscore();
my_score = _root.score;
my_name = _root.postname + _root.storedtime2;
}
function loadUI(lev)
{
_root.attachMovie("mainui","mainui",10000);
_root.mainui.gotoAndStop(lev);
mainui.ui.ui_obj.gotoAndStop(_root.uiobj);
_root.uitext1 = 0;
_root.uitext2 = 0;
_root.minute = 0;
}
function addlevel(current)
{
switch(current)
{
case 1:
_root.bonus = 0;
_root.lady = setInterval(ladybug,43000);
_root.dropsome();
base.attachMovie("enemypak1","enemy1",7006,{xset:arrayx1,yset:arrayy1,arraydir:arraydir1,_x:489,_y:254,nametext:"enemy1"});
base.enemy1.hook.attachMovie("handsred","b_unit",1);
_root.powerupadded = 0;
crowint.clearInterval();
crowint = setInterval(function()
{
crow.singleshot("crow",true);
c_dir = Math.randomBetween(120,350);
_root.attachMovie("bird","bird",10003,{_y:c_dir,adder2:c_dir,originy:c_dir});
}
,30000);
switch(_root.charchoice)
{
case "boy":
base.attachMovie("boy_c","char1",10001);
base.char1.hook.attachMovie("handsred","b_unit",1);
break;
case "girl":
base.attachMovie("girl","char1",10001);
base.char1.hook.attachMovie("handsred","b_unit",1);
break;
case "bear":
base.attachMovie("bear","char1",10001);
base.char1.hook.attachMovie("handsred","b_unit",1);
}
base.char1.waterpressure = 0;
_root.ammotype = 1;
_root.superr = true;
if(_root.intense > 0)
{
_root.hop1 = setInterval(function()
{
attachhopper(220,1,_root.hop1);
clearInterval(_root.hop1);
}
,22000);
_root.hop2 = setInterval(function()
{
attachhopper(224,1,_root.hop2);
clearInterval(_root.hop2);
}
,43000);
}
else
{
_root.hop1 = setInterval(function()
{
attachhopper(220,1,_root.hop1);
clearInterval(_root.hop1);
}
,22000);
}
base.char1.hh = 0;
base.char1.powerupcounter = 1;
if(_root.charchoice != "bear")
{
base.char1.hook.b_unit.gotoAndStop(1);
}
else
{
base.char1.hook.b_unit.gotoAndStop(8);
}
base.char1._x = 80;
base.char1._y = 300;
base.attachMovie("pointer","pointer",3000);
base.attachMovie("button","button",600);
_root.powerupnum = 0;
base.char1.ballooncount = 20;
base.char1.powerupcounter = 0;
add_crow();
base.powerup.num = 0;
base.dropoz = 0;
add_powerup();
dropsuper();
gametime(1);
break;
case 2:
_root.bonus = 0;
_root.lady = setInterval(ladybug,43000);
_root.dropsome();
_root.beezid = setInterval(launchbeez,20020);
base.attachMovie("enemypak2","enemy1",7006,{xset:arrayx2,yset:arrayy2,arraydir:arraydir2,_x:489,_y:254,nametext:"enemy1"});
base.enemy1.hook.attachMovie("handsred","b_unit",1);
_root.powerupadded = 0;
crowint.clearInterval();
crowint = setInterval(function()
{
crow.singleshot("crow",true);
c_dir = Math.randomBetween(120,350);
_root.attachMovie("bird","bird",10003,{_y:c_dir,adder2:c_dir,originy:c_dir});
}
,30000);
switch(_root.charchoice)
{
case "boy":
base.attachMovie("boy_c","char1",10001);
base.char1.hook.attachMovie("handsred","b_unit",1);
break;
case "girl":
base.attachMovie("girl","char1",10001);
base.char1.hook.attachMovie("handsred","b_unit",1);
break;
case "bear":
base.attachMovie("bear","char1",10001);
base.char1.hook.attachMovie("handsred","b_unit",1);
base.char1.hook.b_unit.gotoAndStop(8);
}
_root.ammotype = 1;
_root.superr = true;
base.char1.hh = 0;
base.char1.powerupcounter = 1;
if(_root.charchoice != "bear")
{
base.char1.hook.b_unit.gotoAndStop(1);
}
else
{
base.char1.hook.b_unit.gotoAndStop(8);
}
base.char1._x = 80;
base.char1._y = 300;
base.attachMovie("pointer","pointer",3000);
base.attachMovie("button","button",600);
_root.powerupnum = 0;
base.char1.ballooncount = 20;
base.char1.powerupcounter = 0;
_root.hop1 = setInterval(function()
{
attachhopper(220,1);
clearInterval(_root.hop1);
}
,12000);
_root.hop2 = setInterval(function()
{
attachhopper(224,2);
clearInterval(_root.hop2);
}
,23000);
add_crow();
base.powerup.num = 0;
base.dropoz = 0;
add_powerup();
dropsuper();
gametime(1);
break;
case 3:
_root.bonus = 0;
_root.lady = setInterval(ladybug,43000);
_root.dropsome();
base.attachMovie("enemypak1","enemy1",7006,{xset:arrayx1,yset:arrayy1,arraydir:arraydir1,_x:489,_y:254,nametext:"enemy1"});
base.enemy1.hook.attachMovie("handsred","b_unit",1);
base.attachMovie("enemypak3","enemy3",7007,{xset:arrayx3,yset:arrayy3,arraydir:arraydir3,_x:489,_y:254,nametext:"enemy3"});
base.enemy3.hook.attachMovie("handsred","b_unit",2);
base.enemy3.hook.b_unit.gotoAndStop(8);
_root.powerupadded = 0;
crowint.clearInterval();
crowint = setInterval(function()
{
crow.singleshot("crow",true);
c_dir = Math.randomBetween(120,350);
_root.attachMovie("bird","bird",10003,{_y:c_dir,adder2:c_dir,originy:c_dir});
}
,30000);
base.enemy3.hook.b_unit.gotoAndStop(8);
switch(_root.charchoice)
{
case "boy":
base.attachMovie("boy_c","char1",10001);
base.char1.hook.attachMovie("handsred","b_unit",1);
break;
case "girl":
base.attachMovie("girl","char1",10001);
base.char1.hook.attachMovie("handsred","b_unit",1);
break;
case "bear":
base.attachMovie("bear","char1",10001);
base.char1.hook.attachMovie("handsred","b_unit",1);
}
_root.ammotype = 1;
_root.superr = true;
base.char1.hh = 0;
base.char1.powerupcounter = 1;
if(_root.charchoice != "bear")
{
base.char1.hook.b_unit.gotoAndStop(1);
}
else
{
base.char1.hook.b_unit.gotoAndStop(8);
}
base.char1._x = 80;
base.char1._y = 300;
base.attachMovie("pointer","pointer",3000);
base.attachMovie("button","button",600);
_root.powerupnum = 0;
base.char1.ballooncount = 20;
base.char1.powerupcounter = 0;
_root.hop1 = setInterval(function()
{
attachhopper(220,2);
clearInterval(_root.hop1);
}
,20000);
_root.hop2 = setInterval(function()
{
attachhopper(224,2);
clearInterval(_root.hop2);
}
,33000);
_root.hop3 = setInterval(function()
{
attachhopper(220,1);
clearInterval(_root.hop3);
}
,42000);
_root.hop4 = setInterval(function()
{
attachhopper(224,2);
clearInterval(_root.hop4);
}
,23000);
add_crow();
base.powerup.num = 0;
base.dropoz = 0;
add_powerup();
dropsuper();
gametime(1);
}
}
function grasshoppers()
{
}
function attachhopper(depth, typ)
{
if(_root._currentframe == 20)
{
intvz = input;
switch(typ)
{
case 1:
hoppercount++;
xxpoz = Math.randomBetween(10,80);
yypoz = Math.randomBetween(90,300);
crickin.singleshot("crickin",true);
_root.base.attachMovie("hopper","h" + hoppercount++,10050 + hoppercount,{myweight:10,jstrength:70,jdist:1.5,_y:yypoz,_x:xxpoz,originy:yypoz,hatchtime:random(100),name:1,intervalz:input,typ:typ});
break;
case 2:
hoppercount++;
crickin.singleshot("crickin",true);
xxpoz = Math.randomBetween(10,80);
yypoz = Math.randomBetween(90,300);
_root.base.attachMovie("hopper_f","h" + hoppercount++,10050 + (hoppercount + 20),{myweight:10,jstrength:60,jdist:5,_y:yypoz,_x:xxpoz,originy:yypoz,hatchtime:random(100),name:2,intervalz:input,typ:typ});
}
if(hoppercount > 10)
{
hoppercount = 0;
}
}
}
function doThisAfter(milliseconds, typ)
{
var id = setInterval(function()
{
if(_root._currentframe == 20)
{
attachhopper(220,typ);
}
clearInterval(id);
clearInterval(i);
}
,milliseconds);
}
function bee()
{
this.movearray = [[20,-80,10,40,-100],[50,-70,30,-50,90]];
}
function hive()
{
}
function bobletter()
{
this.gotoAndStop(bob_array[this.name]);
counter = 0;
delay = 300;
}
globalsoundcontrol = new Sound();
_root.holdit = false;
Object.registerClass("balloon0",balloon);
attachMovie("masker","masker",9000000000000);
_root.attachMovie("quitbutton","quitbut",9000000000002,{_x:485,_y:365});
base.char1.ballooncount = 20;
Object.registerClass("enemypak1",opponent);
Object.registerClass("enemypak2",opponent);
Object.registerClass("ladybug",ladybug);
Object.registerClass("enemypak3",opponent);
Object.registerClass("bird",bird);
Object.registerClass("boy_c",character);
Object.registerClass("bear",character);
Object.registerClass("Pup_holder",powerup);
Object.registerClass("star",star);
Object.registerClass("balloon1",balloon);
Object.registerClass("super",balloon);
Object.registerClass("super1",superz);
Object.registerClass("super2",balloon);
Object.registerClass("super_2",superz);
Object.registerClass("balloon2",balloon);
Object.registerClass("board_rules",boards);
Object.registerClass("tallyboard1",boards);
Object.registerClass("board_controls",boards);
Object.registerClass("sorryboard",boards);
Object.registerClass("tallyboard",boards);
Object.registerClass("board_register",boards);
Object.registerClass("char_setup",boards);
Object.registerClass("board_score",boards);
Object.registerClass("scoreboardmain",boards);
Object.registerClass("endround",boards);
Object.registerClass("scrollblock",scrollblock);
Object.registerClass("tree1",tree_class);
Object.registerClass("grass_long",tree_class);
Object.registerClass("picnik",tree_class);
ladybug.prototype = new MovieClip();
superz.prototype = new MovieClip();
tree_class.prototype = new MovieClip();
powerup.prototype = new MovieClip();
bird.prototype = new MovieClip();
boards.prototype = new MovieClip();
balloon.prototype = new MovieClip();
star.prototype = new MovieClip();
scrollblock.prototype = new MovieClip();
boards.prototype.onEnterFrame = function()
{
if(this.inside.unlock)
{
this.direction = 2;
}
switch(this.name)
{
case "menu":
this.spinit(2,4,true);
break;
case "level1":
this.spinit(1,8,true);
break;
case "level2":
this.spinit(1,8,true);
break;
case "level3":
this.spinit(1,8,true);
break;
case "gameover":
this.inner.gotoAndStop("level1over");
this.spinit(1,4,true);
}
};
_root.pickedup = true;
_quality = "Low";
stop();
initializemouse = true;
Movieclip.prototype.mousemove = function()
{
if(_root.initializemouse)
{
this.xtarget = 240;
this.ytarget = 200;
this.xstart = this._x;
this.ystart = this._y;
_root.initializemouse = false;
}
if(base.hitsite.hitTest(_root._xmouse,_root._ymouse,true))
{
this.xtarget = this._x;
this.ytarget = this._y;
}
this.x = Math.abs(this.xstart - this.xtarget);
this.y = Math.abs(this.ystart - this.ytarget);
if(this.x > this.y)
{
this.xspeed = 3;
this.yspeed = 3 * (this.y / this.x);
}
else
{
this.yspeed = 3;
this.xspeed = 3 * (this.x / this.y);
}
this.xtarget + 2;
if(this._x > 5 || this._x < this.xtarget - 2.5 || this._y > this.ytarget + 2.5 || this._y < this.ytarget - 2.5)
{
if(this._x > this.xtarget)
{
this._x -= this.xspeed;
}
else
{
this._x += this.xspeed;
}
if(this._x > this.xtarget - 5)
{
this.dir = "left";
this.dirnum = 1;
}
if(this._x < this.xtarget + 12)
{
this.dir = "right";
this.dirnum = 2;
}
if(this._y > this.ytarget + 3)
{
this.dir = "up";
this.dirnum = 3;
}
if(this._y < this.ytarget - 3)
{
this.dir = "down";
this.dirnum = 4;
}
if(this._x == this.xtarget)
{
this.dir = "center";
this.dirnum = 5;
}
if(this._y > this.ytarget)
{
this._y -= this.yspeed;
}
else
{
this._y += this.yspeed;
}
}
else if(this.firing)
{
this.dir = "center";
this.dirnum = 5;
}
this.onMouseDown = function()
{
this.xtarget = _root._xmouse;
this.ytarget = _root._ymouse;
this.xstart = this._x;
this.ystart = this._y;
};
};
Movieclip.prototype.followm = function()
{
if(this._x - base.char1._x <= 0)
{
this.dir = "center";
}
this.Xpos = _xmouse;
this.Ypos = _ymouse;
this._x = base.char1._x;
this._y = base.char1._y;
this.x = this.Xpos - this._x;
this.y = this.Ypos - this._y;
this.r = Math.sqrt(this.x * this.x + this.y * this.y);
this.sinTheta = this.y / this.r;
this.theta = Math.asin(this.sinTheta);
if(this.Xpos < this._x)
{
this._rotation = 270 - this.theta / 0.0174532925199433;
}
else if(this._x < this.Xpos)
{
this._rotation = 90 + this.theta / 0.0174532925199433;
}
};
_root.onMouseUp = function()
{
base.char1.firing = true;
base.char1.gotoAndPlay(1);
base.char1.dir = 5;
if(base.hitsite.hitTest(_xmouse,_ymouse,true))
{
if(Math.floor(base.char1._x - _root._xmouse < 0))
{
base.char1.gotoAndStop("right");
}
if(Math.floor(base.char1._y - _root._ymouse > 0) and Math.floor(base.char1._x - _root._xmouse > -20))
{
base.char1.gotoAndStop("center");
}
}
else
{
this.firing = false;
this.moveme = false;
}
};
_root.onMouseDown = function()
{
if(base.hitsite.hitTest(_xmouse,_ymouse,true) and _root.holdit == false and base.char1.ballooncount >= 0)
{
base.char1.firing = false;
this.numm = this.numm + 1;
if(base.char1.ballooncount < 0)
{
this.hit = false;
base.char1.holdfire = false;
base.char1.gotoAndStop("centern");
}
base.char1.ballooncount--;
base.char1.dir = "false";
this.moving = false;
targ_y = base.pointer._y;
targ_x = base.pointer._x;
if(base.char1.ballooncount >= 0)
{
blurp.singleshot("blurp",true);
switch(_root.ammotype)
{
case 1:
this.colorz = random(3);
attachMovie("balloon" + this.colorz,[1],this.numm + 3000,{_x:targ_x,_y:targ_y,_rotation:base.pointer._rotation,name:base.char1,tag:en,typ:1,colorz:this.colorz});
break;
case 2:
attachMovie("super",[1],this.numm + 3000,{_x:targ_x,_y:targ_y,_rotation:base.pointer._rotation,name:base.char1,tag:"me",typ:2,colorz:"star"});
break;
case 3:
attachMovie("super2",[1],this.numm + 3000,{_x:targ_x,_y:targ_y,_rotation:base.pointer._rotation,name:base.char1,tag:"me",typ:2,colorz:"sun"});
}
if(Math.floor(base.char1._x - _root._xmouse < 0))
{
base.char1.gotoAndStop("throwright");
}
if(Math.floor(base.char1._y - _root._ymouse > 0) and Math.floor(base.char1._x - _root._xmouse > -20))
{
base.char1.gotoAndStop("throwup");
}
}
}
else
{
this.moving = true;
}
};
ladybug.prototype.onEnterFrame = function()
{
if(!this.init)
{
this.cool = false;
this.init = true;
}
this.blinker(30);
this.lifetimer = this.lifetimer + 1;
if(this._y == 0)
{
this.cool = false;
delete this.onEnterFrame();
this.removeMovieClip();
}
if(this.lifetimer > 290)
{
this.dir = 2;
}
else
{
this.dir = 1;
}
if(this.hitTest(_root.base.char1))
{
this.gotoAndPlay("up");
if(!this.cool)
{
this.fly = true;
this.gotoAndPlay("up");
cool.singleshot("cool",true);
if(_root.base.char1.ballooncount <= 0)
{
_root.base.char1.ballooncount += 6;
}
else
{
_root.base.char1.ballooncount += 5;
}
this.lifetimer = 360;
base.char1.attachMovie("ladyx","ladyx",7,{_x:base.char1.hook._x,_y:base.char1.hook._y});
this.cool = true;
}
}
if(this.lifetimer > 350)
{
if(!this.fly)
{
ladyout.singleshot("ladyout",true);
this.gotoAndPlay("up");
this.fly = true;
}
this.up = this.up + 1;
this._y -= 1 * (this.up / 10);
this._x += Math.sin(this._y / 5) * 2;
}
else if(!this.fly)
{
switch(this.dir)
{
case 1:
if(!this.lock)
{
this.gotoAndPlay("right");
this.lock = true;
}
this._x += 1;
break;
case 2:
if(!this.lockx)
{
this.gotoAndPlay("left");
this.lockx = true;
}
this._x -= 1;
}
}
};
superz.prototype.onEnterFrame = function()
{
if(this.hitTest(_root.base.char1))
{
dropsuper();
_root.holdit = false;
superbz.singleshot("superbz",true);
superb.singleshot("superb",true);
_root.base.char1.hh = 0;
if(this.tag == 2)
{
_root.ammotype = 3;
base.attachMovie("bsup1","bsupz",10,{_x:this._x - 10,_y:this._y});
base.char1.hook.b_unit.gotoAndStop(5);
}
else
{
base.attachMovie("bsup2","bsupz",10,{_x:this._x - 10,_y:this._y});
base.char1.hook.b_unit.gotoAndStop(2);
_root.ammotype = 2;
}
this.removeMovieClip();
}
this.blinker(30);
this.i = this.i + 1;
if(this.i > 120 and this.i < 122)
{
this.hh = 0;
}
if(this.i > 160)
{
this.i = 0;
superout.singleshot("superout",true);
dropsuper();
this.removeMovieClip();
}
};
powerup.prototype.onEnterFrame = function()
{
if(!this.init)
{
this.i = 0;
this.init = true;
}
this.blinker(30);
this.i = this.i + 1;
if(this.i > 120 and this.i < 122)
{
this.hh = 0;
}
if(this.i > 180)
{
pupout.singleshot("pupout",true);
_root.powerupadded--;
_root.pickedup = true;
dropsome();
this.removeMovieClip();
}
if(this.hitTest(_root.base.char1))
{
base.char1.attachMovie("rings","rings",6,{_x:base.char1.hook._x,_y:base.char1.hook._y});
base.char1.hh = 0;
mainui.ui.powerupmeter.gotoAndStop(_root.powerupadded + 1);
mainui.ui.powerupmeter["p_jar" + _root.powerupadded].gotoAndStop(_root.p_array[_root.p_num]);
switch(_root.p_array[_root.p_num])
{
case "1":
strawberry.singleshot("strawberry ",true);
pup2.singleshot("powerup_grabbed",true);
break;
case "2":
icecream.singleshot("icecream ",true);
pup2.singleshot("powerup_grabbed",true);
break;
case "3":
frenchfries.singleshot("frenchfries",true);
pup2.singleshot("powerup_grabbed",true);
break;
case "4":
pancake.singleshot("pancake",true);
pup2.singleshot("powerup_grabbed",true);
break;
case "5":
cookie.singleshot("cookie",true);
pup2.singleshot("powerup_grabbed",true);
break;
case "6":
tomatoes.singleshot("tomatoes",true);
pup2.singleshot("powerup_grabbed",true);
break;
case "7":
carrotz.singleshot("carrotz",true);
pup2.singleshot("powerup_grabbed",true);
break;
case "8":
water.singleshot("watermelon ",true);
pup2.singleshot("powerup_grabbed",true);
break;
case "9":
pudding.singleshot("pudding",true);
pup2.singleshot("powerup_grabbed",true);
break;
case "10":
pbj.singleshot("pbj",true);
pup2.singleshot("powerup_grabbed",true);
break;
case "11":
corn.singleshot("corn",true);
pup2.singleshot("powerup_grabbed",true);
break;
case "12":
pear.singleshot("pear",true);
pup2.singleshot("powerup_grabbed",true);
}
_root.p_array.splice(_root.p_num,1);
strawb_in.singleshot("strawb_in",true);
_root.p_left--;
_root.pickedup = true;
this.removeMovieClip();
clearInterval(_root.pupint);
dropsome();
}
};
Object.registerClass("boy_c",character);
Object.registerClass("girl",character);
character.prototype = new MovieClip();
character.prototype.onEnterFrame = function()
{
if(this.ballooncount < 0)
{
_root.balloontick = 0;
this.balloncount = 0;
}
_root.balloontick = int(this.ballooncount);
_root.yoursplash = _root.op1 + _root.op2;
if(_root.op1 + _root.op2 >= 5 and this.warningsoundzz != true)
{
warningzz.singleshot("warningzz",true);
this.warningsoundzz = true;
}
_root.chartag = _root.uitext1 + _root.uitext2;
this.blinker(30);
switch(_root.currentlevel)
{
case 1:
if(_root.p_array.length < 1)
{
drop();
}
break;
case 2:
if(_root.p_array.length < 1)
{
drop();
}
break;
case 3:
if(_root.p_array.length < 1)
{
drop();
}
}
if(this.ballooncount > 20)
{
this.ballooncount = 20;
}
base.pointer.followm();
if(this._x > 420 and this._y < 200)
{
if(!this.leavers)
{
if(_root.currentlevel < 3)
{
leaver.singleshot("leaver",true);
}
else
{
winsound.singleshot("winsound",true);
}
this.leavers = true;
}
base.Pup_holder.removeMovieClip();
clearInterval(_root.pupint);
clearInterval(_root.hopint);
clearInterval(_root.beezid);
base.superp.removeMovieClip();
this.removeMovieClip();
_root.passed = true;
clearInterval(_root.supint);
_root.state = "clear";
_root.sticker = 0;
_root.holdit = false;
base.ladybug.removeMovieClip();
clearInterval(_root.lady);
_root.state = "clear";
clearInterval(_root.hop1);
clearInterval(_root.hop2);
clearInterval(_root.hop3);
clearInterval(_root.hop4);
doThisAfter(1);
gotoAndPlay(28);
this.dropfence = false;
base.removeMovieClip();
mainui.removeMovieClip();
}
if(_root.op1 + _root.op2 >= 10 || _root.sticker >= 3)
{
doThisAfter(1);
if(_root.sticker >= 3)
{
_root.frogsign = true;
}
_root.holdit = false;
_root.sticker = 0;
_root.passed = false;
base.ladybug.removeMovieClip();
clearInterval(_root.lady);
base.Pup_holder.removeMovieClip();
base.superp.removeMovieClip();
_root.state = "clear";
clearInterval(_root.hop1);
clearInterval(_root.hop2);
clearInterval(_root.hop3);
clearInterval(_root.hop4);
_root.crits = true;
_root.gotoAndPlay("clearlevel");
clearInterval(_root.lady);
clearInterval(_root.supint);
this.dropfence = false;
_root.base.removeMovieClip();
mainui.removeMovieClip();
}
if(this.hitTest(_level0[0]))
{
this.randomcry = random(20);
if(this.randomcry == 5)
{
laugh2.singleshot("laugh2",true);
}
if(this.randomcry == 8)
{
goodhit.singleshot("goodhit",true);
}
if(this.randomcry == 18)
{
longlaugh.singleshot("longlaugh",true);
}
this.hit = true;
base.attachMovie("splasher","splash",240000,{_y:this._y,_x:this._x});
base.attachMovie("popper" + _level0[0].colorz,"red",230000,{_y:this._y,_x:this._x});
this.gotoAndPlay("hit");
_root.score2.singleshot("score2",true);
switch(_level0[0].name)
{
case _level0.base.enemy1:
_root.op1 = _root.op1 + 1;
this.hitspin = 0;
break;
case _level0.base.enemy3:
_root.op2 = _root.op2 + 1;
this.hitspin = 0;
}
delete _level0[0].onEnterFrame;
_level0[0].removeMovieClip();
}
else if(this.hitspin > 20)
{
_root.moveme = true;
this.hit = false;
}
else
{
this.hitspin = this.hitspin + 1;
}
if(_root.chartag < 0)
{
_root.chartag = 0;
}
if(this.hitTest(base.spiket1))
{
if(_root.charchoice == "bear")
{
base.char1.hook.b_unit.gotoAndStop(8);
}
else
{
base.char1.hook.b_unit.gotoAndStop(1);
}
if(!this.soundinit)
{
fill.singleshot("fillup",true);
this.soundinit = true;
}
_root.base.spiket1.gotoAndStop(1);
_root.holdit = false;
_root.mainui.ui.pressure.gotoAndStop(int(this.waterpressure));
if(this.waterpressure > 0)
{
this.waterpressure -= 0.1;
this.ballooncount += 0.1;
this.balloncount = Math.floor(this.ballooncount);
}
_root.ammotype = 1;
}
else
{
if(this.waterpressure < 20)
{
_root.mainui.ui.pressure.gotoAndStop(int(this.waterpressure));
this.waterpressure += 0.1;
this.waterpl = false;
}
else
{
if(!this.waterpl)
{
_root.base.attachMovie("pipesplash","piper",77000,{_y:base.spiket1._y,_x:base.spiket1._x});
waterppp.singleshot("wateron",true);
this.waterpl = true;
}
base.spiket1.play();
}
this.soundinit = false;
this.ballooncount = int(this.ballooncount);
}
if(this.waterpressure <= 2)
{
if(!this.waterp)
{
girgle.singleshot("girgle",true);
this.waterp = true;
}
}
else
{
this.waterp = false;
}
if(- Math.floor(this._x - _root._xmouse) > 0)
{
this.dist = - Math.floor(this._x - _root._xmouse);
}
else
{
this.dist = Math.floor(this._x - _root._xmouse);
}
this.adder = int(this.dist / 15);
if(- Math.floor(this._y - _root._ymouse) > 0)
{
this.distY = - Math.floor(this._y - _root._ymouse);
}
else
{
this.distY = Math.floor(this._y - _root._ymouse);
}
this.adder2 = int(this.distY / 12);
if(_root.initializemouse)
{
this.xtarget = 180;
this.ytarget = 200;
this.xstart = this._x;
this.ystart = this._y;
_root.initializemouse = false;
}
if(base.hitsite.hitTest(_root._xmouse,_root._ymouse,true))
{
this.xtarget = this._x;
this.ytarget = this._y;
}
if(!base.hitTest(_root._xmouse,_root._ymouse,true))
{
this.xtarget = this._x;
this.ytarget = this._y;
}
this.x = Math.abs(this.xstart - this.xtarget);
this.y = Math.abs(this.ystart - this.ytarget);
if(this.x > this.y)
{
this.xspeed = 3;
this.yspeed = 3 * (this.y / this.x);
}
else
{
this.yspeed = 3;
this.xspeed = 3 * (this.x / this.y);
}
if(this._x > this.xtarget + 2 || this._x < this.xtarget - 2 || this._y > this.ytarget + 2 || this._y < this.ytarget - 2)
{
if(this._x > this.xtarget)
{
this._x -= this.xspeed;
}
else
{
this._x += this.xspeed;
}
if(this._x > this.xtarget - 50)
{
this.dir = "left";
this.dirnum = 1;
}
if(this._x < this.xtarget + 50)
{
this.dir = "right";
this.dirnum = 2;
}
if(this._y > this.ytarget + 40)
{
this.dir = "up";
this.dirnum = 3;
}
if(this._y < this.ytarget - 40)
{
this.dir = "down";
this.dirnum = 4;
}
if(this._y > this.ytarget)
{
this._y -= this.yspeed;
}
else
{
this._y += this.yspeed;
}
}
else
{
if(this.firing)
{
this.dir = "center";
}
this.dirnum = 5;
}
this.onMouseDown = function()
{
base.char1.moveme = true;
this.xtarget = _root._xmouse;
this.ytarget = _root._ymouse;
this.xstart = this._x;
this.ystart = this._y;
};
mainui.ui.powerbar.bar.gotoAndPlay(this.adder);
if(!mainui.ui.cholder._visible)
{
with(mainui.ui.fballoon)
{
blinker(30);
if(hh > 30)
{
hh = 0;
}
}
}
if(this.ballooncount < 0)
{
if(_root.charchoice != "bear")
{
base.char1.hook.b_unit.gotoAndStop(1);
}
else
{
base.char1.hook.b_unit.gotoAndStop(8);
}
mainui.ui.cholder._visible = false;
mainui.ui.getmore._visible = true;
}
else
{
mainui.ui.cholder._visible = true;
mainui.ui.getmore._visible = false;
}
this.balloncountz = this.ballooncount;
if(!this.hit)
{
if(this.ballooncount > 0)
{
switch(this.dir)
{
case "right":
this.gotoAndStop("right");
break;
case "left":
this.gotoAndStop("left");
break;
case "down":
this.gotoAndStop("down");
break;
case "up":
this.gotoAndStop("up");
break;
case "center":
this.gotoAndStop("center");
}
}
else
{
switch(this.dir)
{
case "right":
this.gotoAndStop("rightn");
break;
case "left":
this.gotoAndStop("leftn");
break;
case "down":
this.gotoAndStop("downn");
break;
case "up":
this.gotoAndStop("upn");
break;
case "center":
this.gotoAndStop("centern");
}
}
}
};
opponent.prototype = new MovieClip();
opponent.prototype.onEnterFrame = function()
{
if(this.hitTest(_level0[1]))
{
_root.charpoint = _root.charpoint + 1;
if(_root.charpoint == 10)
{
scorepoint.singleshot("pointsz",true);
_root.charpoint = 0;
}
this.randomcry = random(80);
switch(this.randomcry)
{
case 5:
cry.singleshot("cry",true);
break;
case 67:
niceone.singleshot("niceone",true);
break;
case 72:
gotcha.singleshot("gotcha",true);
break;
case 25:
cry.singleshot("cry",true);
break;
case 24:
lookout.singleshot("lookout",true);
break;
case 56:
cry.singleshot("cry",true);
break;
case 18:
hehe.singleshot("hehe",true);
break;
case 22:
longestlaugh.singleshot("longestlaugh",true);
}
this.moveme = false;
base.attachMovie("popper" + _level0[1].colorz,"red2",230001,{_y:this._y,_x:this._x});
switch(_level0[1].colorz)
{
case "star":
supersplash.singleshot("supersplash",true);
base.attachMovie("popper_star","popstar",240002,{_y:this._y,_x:this._x});
break;
case "sun":
supersplash.singleshot("supersplash",true);
base.attachMovie("popper_sun","popsun",240003,{_y:this._y,_x:this._x});
}
base.attachMovie("splasher","splash",240001,{_y:this._y,_x:this._x});
this.gotoAndPlay("hit");
switch(this.nametext)
{
case "enemy1":
_root.uitext1 += _level0[1].typ;
_root.scory.singleshot("score1",true);
_level0[1].removeMovieClip();
break;
case "enemy3":
_root.uitext2 += _level0[1].typ;
_root.scory.singleshot("score1",true);
_level0[1].removeMovieClip();
}
}
this.cx = this._x - base.char1._x;
this.cy = this._y / base.char1._y;
this.adder = this.cx / 15;
if(this.cx < 430 and this.cy < 5 and this.cy > 0.4 and this.shutdown == false)
{
this.seconds = random(_root.op_throw);
if(this.seconds < _root.throwlock)
{
this.moveme = false;
if(this.tosscount < 3)
{
this.tosscount = this.tosscount + 1;
this.fire("left",true,this.adder);
this.gotoAndStop("throwleft");
}
}
else if(this.hit == false and this.moveme == true)
{
this.gotoAndStop("center");
this.tosscount = 0;
this.fire("left",false);
}
}
if(this.cy < 500 and this.cx < 120 and this.shutdown == false)
{
this.seconds = random(_root.op_throw);
if(this.seconds < _root.throwlock)
{
this.moveme = false;
if(this.tosscount < 3)
{
this.tosscount = this.tosscount + 1;
this.fire("down",true,this.adder);
this.gotoAndStop("throwdown");
}
}
else if(this.hit == false and this.moveme == true)
{
this.gotoAndStop("center");
this.fire("up",false);
this.tosscount = 0;
}
}
if(!this.hit)
{
this.arr = arr;
if(this.xx <= this.xset.length and this.edir == 1)
{
this.xx = this.xx + 1;
this.forwards = true;
this._x = this.xset[this.xx];
this._y = this.yset[this.xx];
}
else
{
this.edir = 2;
}
if(this.xx > 0 and this.edir == 2)
{
this.xx--;
this.forwards = false;
this._x = this.xset[this.xx];
this._y = this.yset[this.xx];
}
else
{
this.edir = 1;
}
if(this.moveme)
{
if(this.forwards)
{
switch(this.arraydir[this.xx])
{
case 3:
this.gotoAndStop("up");
break;
case 4:
this.gotoAndStop("down");
break;
case 2:
this.gotoAndStop("right");
break;
case 1:
this.gotoAndStop("left");
break;
case 5:
this.gotoAndStop("center");
}
}
else
{
switch(this.arraydir[this.xx])
{
case 3:
this.gotoAndStop("down");
break;
case 4:
this.gotoAndStop("up");
break;
case 2:
this.gotoAndStop("left");
break;
case 1:
this.gotoAndStop("right");
break;
case 5:
this.gotoAndStop("center");
}
}
}
}
};
bird.prototype.onEnterFrame = function()
{
this._x += 2.5;
if(this.hitTest(base.char1))
{
if(!this.sound)
{
crowattack.singleshot("crowattack",true);
this.sound = true;
}
if(base.char1.ballooncount > 5)
{
base.char1.ballooncount--;
}
this.gotoAndPlay(11);
}
if(!this.init1)
{
this.originx = this._x;
this.init1 = true;
}
this.birdwobbler(3,34.5,50,15,10);
if(this._x > 630)
{
if(!returning)
{
delete this.onEnterFrame;
this.removeMovieClip();
}
else
{
this._x = this.originx - 20;
}
}
};
Math.randomBetween = function(a, b)
{
return a + Math.floor(Math.random() * (b - a + 1));
};
movieclip.prototype.wobbler1 = function(tempo, dim, ddim, alpha, dalpha, adder, adder2)
{
this.originy = adder2;
this._y = this.originy + adder + dim + ddim * Math.sin(this.i * 3.141592653589793 / 180);
this.i += tempo;
if(this.i >= 360)
{
this.i = 0;
}
};
movieclip.prototype.birdwobbler = function(tempo, dim, ddim, alpha, dalpha)
{
this._y = this.originy + dim + ddim * Math.sin(this.i * 3.141592653589793 / 180);
this.i += tempo;
if(this.i >= 360)
{
this.i = 0;
}
};
Movieclip.prototype.blinker = function(setblink)
{
if(!this.colorinit)
{
this.hh = 0;
this.s = [0,255,0,255,0,255,0,255,0,255,0,255];
this.c = new Color(this);
this.colorinit = true;
}
if(this.hh < this.s.length)
{
this.hh = this.hh + 1;
this.c.setBrightOffset(this.s[this.hh]);
}
};
Color.prototype.setBrightOffset = function(offset)
{
if(!this.blinkinit)
{
this.hh = 0;
this.blinkinit = true;
}
this.trans = new Object();
this.trans.rb = this.trans.gb = this.trans.bb = offset;
this.setTransform(this.trans);
};
Color.prototype.setTint = function(r, g, b, amount)
{
var percent = 100 - amount;
var trans = new Object();
trans.ra = trans.ga = trans.ba = percent;
var ratio = amount / 100;
trans.rb = r * ratio;
trans.gb = g * ratio;
trans.bb = b * ratio;
this.setTransform(trans);
};
Movieclip.prototype.spinit = function(method, seconds, removeit, mytarg)
{
if(!this.spininit)
{
this._alpha = 0;
this.inside._xscale = 0;
this.inside._yscale = 0;
this.direction = 1;
this.spininit = true;
}
if(this.inside._xscale < 100 and this.direction != 2)
{
this.inside._rotation += 72;
this._alpha += 10;
this.inside._xscale += 10;
this.inside._yscale += 10;
this.t1 = this.t1 + 1;
}
switch(method)
{
case 1:
if(this.inside._xscale >= 100)
{
if(!this.soundz)
{
readyz.singleshot("readyz",true);
this.soundz = true;
}
if(this.spintimer > seconds * 10 and this.spintimer < seconds * 20)
{
if(!this.sound2)
{
setter.singleshot("setter",true);
this.sound2 = true;
}
this.inside.ready.gotoAndStop(2);
}
if(this.spintimer > seconds * 20)
{
if(!this.sound3)
{
go.singleshot("go",true);
this.sound3 = true;
}
this.inside.ready.gotoAndStop(3);
}
if(this.spintimer >= seconds * 30)
{
this.direction = 2;
}
else
{
this.spintimer = this.spintimer + 1;
}
}
break;
case 2:
}
if(this.direction != 1)
{
_root.menu.prototype.locked = false;
this.inside._rotation -= 72;
this._alpha -= 5;
this.inside._xscale -= 5;
this.inside._yscale -= 5;
this.t1--;
if(this._alpha <= 1)
{
switch(this.name)
{
case "level1":
addlevel(1);
break;
case "level2":
addlevel(2);
break;
case "level3":
addlevel(3);
}
if(this.tag == "end")
{
_root.gotoAndStop("intro");
}
menu.currentup = false;
delete this.onEnterFrame;
delete this.inside.ready.onEnterFrame;
this.removeMovieClip();
}
}
};
_root.powerupnum = 0;
this.count = 0;
while(this.count < 5)
{
_root["uitext" + this.count] = 0;
this.count = this.count + 1;
}
Movieclip.prototype.stardrive = function()
{
this._y -= 0.3;
this._x = Math.sin(this._y);
};
this.edir == 1;
Movieclip.prototype.gravity = function(death, adder)
{
this.adder = adder;
if(!this.initg)
{
this.originy = this._y;
this.initg = true;
}
if(this._y > this.originy + death)
{
this.nextFrame();
}
this._y += this.vy;
this.vy += (45 - this.adder) / 20;
this.vx /= 1.02;
};
shock = new Sound();
gozz = new Sound();
frog = new Sound();
namenter = new Sound();
hopout = new Sound();
pupout = new Sound();
superout = new Sound();
balloonsound = new Sound();
crickin = new Sound();
beeleave = new Sound();
girgle = new Sound();
waterppp = new Sound();
blurp = new Sound();
ladyin = new Sound();
ladyout = new Sound();
cool = new Sound();
fill = new Sound();
score = new Sound();
crow = new Sound();
enter = new Sound();
pup2 = new Sound();
fence2 = new Sound();
strawb_in = new Sound();
strawb_out = new Sound();
bossa2 = new Sound();
bossa = new Sound();
titlemain = new Sound();
readyz = new Sound();
setter = new Sound();
go = new Sound();
set("get",new Sound());
superb = new Sound();
cry = new Sound();
energy = new Sound();
titlez = new Sound();
ohno = new Sound();
nextlevel = new Sound();
sorry = new Sound();
corn = new Sound();
laugh2 = new Sound();
highscore = new Sound();
finish = new Sound();
pancake = new Sound();
pudding = new Sound();
pear = new Sound();
niceone = new Sound();
bossa3 = new Sound();
ticky = new Sound();
rollover1 = new Sound();
down = new Sound();
rollover_in = new Sound();
gotcha = new Sound();
intensez = new Sound();
choose = new Sound();
readie = new Sound();
scory = new Sound();
score2 = new Sound();
carrotz = new Sound();
cookie = new Sound();
frenchfries = new Sound();
icecream = new Sound();
pbj = new Sound();
strawberry = new Sound();
tomatoes = new Sound();
water = new Sound();
yuck = new Sound();
djoe = new Sound();
csero = new Sound();
laughz = new Sound();
frogz = new Sound();
superbz = new Sound();
goodhit = new Sound();
lookout = new Sound();
longlaugh = new Sound();
hehe = new Sound();
pupitup = new Sound();
longestlaugh = new Sound();
beesoundz = new Sound();
splash = new Sound();
superup = new Sound();
warning = new Sound();
supersplash = new Sound();
scorepoint = new Sound();
crowattack = new Sound();
beeenter = new Sound();
leaver = new Sound();
scorefin = new Sound();
warningzz = new Sound();
winsound = new Sound();
jumpy = new Sound();
Sound.prototype.singleshot = function(id)
{
this.attachSound(id);
this.start();
};
Sound.prototype.looper = function(id)
{
this.attachSound(id);
this.setVolume = 60;
this.start(0,500000);
};
_root.removed = true;
Movieclip.prototype.shakeit = function()
{
if(!this.init)
{
s = 0;
this.originx = this._x;
this.originy = this._y;
this.init = true;
}
if(this.s < 10)
{
base._x = random(6);
base._y = random(6);
this.s = this.s + 1;
}
else
{
base._x = this.originx;
base._y = this.originy;
}
};
opponent.prototype.fire = function(Fdir, Foff, adder)
{
if(this.shutdown == false and Foff == true)
{
this.i = this.i + 1;
blurp.singleshot("blurp",true);
this.colorz = random(3);
attachMovie("balloon" + this.colorz,[0],this.i + 1,{Fdir:Fdir,adder:adder,who:2,_x:this._x,_y:this._y,name:this,tag:en,colorz:this.colorz});
}
};
balloon.prototype.onEnterFrame = function()
{
if(_root.ammotype == 2 and this.tag == "me")
{
this.droplettimer = this.droplettimer + 1;
if(this.droplettimer > 2)
{
this.tackon = this.tackon + 1;
base.attachMovie("droplet","droplet" + this.tackon,400000 + this.tackon,{_x:this._x,_y:this._y});
this.droplettimer = 0;
}
}
if(_root.ammotype == 3 and this.tag == "me")
{
this.droplettimer = this.droplettimer + 1;
if(this.droplettimer > 2)
{
this.tackon = this.tackon + 1;
base.attachMovie("droplet2","droplet" + this.tackon,400000 + this.tackon,{_x:this._x,_y:this._y});
this.droplettimer = 0;
}
}
if(_root.currentlevel > 3 || _root.intense > 12)
{
this.pthrower = 200;
}
else
{
this.pthrower = 50;
}
if(this.who == 2)
{
switch(this.fdir)
{
case "up":
this._y -= 20;
this.gravity(200,this.adder);
this._rotation += 8;
break;
case "down":
this._y += 12;
this.gravity(200,this.adder);
this._rotation += 8;
break;
case "right":
this._x += 12;
this._y -= 12;
this.gravity(this.pthrower,this.adder);
this._rotation += 8;
break;
case "left":
this._x -= 12;
this._y -= 12;
this.gravity(this.pthrower,this.adder);
this._rotation += 8;
}
}
else
{
this.inner._rotation += 20;
this._y -= Math.cos(0.0174532925199433 * this._rotation) * base.char1.adder2 + 15;
this._x += Math.sin(0.0174532925199433 * this._rotation) * base.char1.adder;
this.gravity();
}
};
tree_class.prototype.onEnterFrame = function()
{
if(this.hitTest(base.char1))
{
if(base.char1._y - base.char1._height / 2 < this._y - this._height / 3)
{
this.swapDepths(20001);
}
else
{
this.swapDepths(801);
}
}
if(this.hitTest(base.enemy1))
{
if(base.enemy1._y - base.enemy1._height / 2 < this._y - this._height / 3)
{
this.swapDepths(20002);
}
else
{
this.swapDepths(802);
}
}
if(this.hitTest(base.enemy2))
{
if(base.enemy2._y - base.enemy2._height / 2 < this._y - this._height / 3)
{
this.swapDepths(20003);
}
else
{
this.swapDepths(803);
}
}
if(this.hitTest(base.enemy3))
{
if(base.enemy3._y - base.enemy3._height / 2 < this._y - this._height / 3)
{
this.swapDepths(20004);
}
else
{
this.swapDepths(804);
}
}
if(this.hitTest(_root.base[4]))
{
if(_root.base[4]._y - _root.base[4]._height / 2 < this._y - this._height / 3)
{
this.swapDepths(20000);
}
else
{
this.base[4].swapDepths(805);
}
}
};
movieclip.prototype.arrowdrive = function(tempo, dim, ddim, alpha, dalpha, adder)
{
if(!this.init)
{
this.originx = this._x;
this.init = true;
}
this.force = this.originx + adder + dim + ddim * Math.sin(this.i * 36 / 180);
this._x = this.force;
this.i += tempo;
if(this.i >= 360)
{
this.i = 0;
}
};
_root.loglocalscore();
Date.prototype.oldDay = Date.prototype.getDay;
Date.prototype.oldMonth = Date.prototype.getMonth;
Date.prototype.oldSeconds = Date.prototype.getSeconds;
Date.prototype.oldMinutes = Date.prototype.getMinutes;
Date.prototype.oldHours = Date.prototype.getHours;
Date.prototype.oldTime = Date.prototype.getTime;
Date.prototype.getSeconds = function()
{
var secs = this.oldSeconds();
secs >= 10 ? null : (secs = "0" + secs);
return secs;
};
Date.prototype.getMinutes = function()
{
var mins = this.oldMinutes();
mins >= 10 ? null : (mins = "0" + mins);
return mins;
};
Date.prototype.getHours = function()
{
var cHour = this.oldHours();
if(cHour < 12)
{
this.morning = " AM";
return cHour;
}
this.morning = " PM";
return cHour - 12;
};
Date.prototype.getTime = function(format)
{
if(arguments.length > 0)
{
if(format == 0)
{
return this.getDay() + " " + this.getDate() + " of " + this.getMonth() + " " + this.getFullYear();
}
if(format == 1)
{
return this.getHours() + ":" + this.getMinutes() + this.morning + "/" + (this.getMonth() + 1) + "/" + this.getDate() + "/" + this.getFullYear();
}
if(format == 2)
{
return this.getMonth() + 1 + "/" + this.getDate() + "/" + this.getFullYear();
}
if(format == 3)
{
return this.toString();
}
}
return this.oldTime();
};
myDate = new Date();
Object.registerClass("hopper",grasshoppers);
Object.registerClass("hopper_f",grasshoppers);
grasshoppers.prototype = new MovieClip();
grasshoppers.prototype.onEnterFrame = function()
{
if(_root._currentframe != 20)
{
doThisAfter(1);
this.removeMovieClip();
delete this.onEnterFrame;
}
if(this.hitTest(_level0[1]))
{
base.attachMovie("grex","grex2",240001,{_y:this._y,_x:this._x});
frog.singleshot("frog",true);
_root.critterhit += 5;
doThisAfter(Math.randomBetween(_root.hopperin,40000),this.typ);
this.removeMovieClip();
delete this.onEnterFrame;
}
if(this.hitTest(_root.base.char1))
{
base.attachMovie("grex","grexz",240002,{_y:this._y,_x:this._x});
_root.sticker = _root.sticker + 1;
frogz.singleshot("frogz",true);
yuck.singleshot("yuck",true);
_root.hoppercurrent = false;
switch(this.name)
{
case 1:
doThisAfter(Math.randomBetween(_root.hopperin,40000),this.typ);
this.removeMovieClip();
delete this.onEnterFrame;
base.char1.hook.b_unit.gotoAndStop(3);
_root.holdit = true;
break;
case 2:
base.char1.hook.b_unit.gotoAndStop(4);
_root.holdit = true;
doThisAfter(Math.randomBetween(_root.hopperin,40000),this.typ);
this.removeMovieClip();
delete this.onEnterFrame;
}
_root.ammotype = 0;
}
if(this.hatchtimer > 20)
{
this.power += 2;
this.count = this.count + 1;
this.dirtime = this.jstrength * this.myweight / 2;
if(this.count > this.dirtime * 2 || _root._currentframe > 21)
{
doThisAfter(Math.randomBetween(_root.hopperin,40000),this.typ);
this.removeMovieClip();
delete this.onEnterFrame;
hopout.singleshot("hopout",true);
_root.hoppercurrent = false;
}
if(this.count > this.dirtime)
{
this.dir = 2;
}
else
{
this.dir = 1;
}
if(this.lock)
{
switch(this.dir)
{
case 1:
this._x += this.jdist;
this.point = "right";
break;
case 2:
this._x -= this.jdist;
this.point = "left";
}
this._y = this.wave;
}
this.wave = Math.sin(this.power / this.myweight) * this.jstrength + this.originy;
if(this.wave < this.originy)
{
this.lock = true;
this.inner.gotoAndStop(this.point);
if(!this.jumpsound)
{
jumpy.singleshot("jumpy",true);
this.jumpsound = true;
}
this.inner.jj.gotoAndStop(2);
}
else
{
this.inner.gotoAndStop(this.point);
if(this.name == 2)
{
if(this.hitTest(_root.base.grass.river))
{
this.inner.jj.gotoAndStop(5);
this.jumpsound = false;
}
if(!this.hitTest(_root.base.grass.river))
{
this.inner.jj.gotoAndStop(1);
this.jumpsound = false;
}
}
else
{
this.jumpsound = false;
this.inner.jj.gotoAndStop(1);
}
this.lock = false;
}
}
else
{
this.hatchtimer = this.hatchtimer + 1;
}
};
Object.registerClass("bee",bee);
bee.prototype = new MovieClip();
Object.registerClass("hive",hive);
bee.prototype = new MovieClip();
hive.prototype = new MovieClip();
hive.prototype.onEnterFrame = function()
{
this.blinker(30);
this.t = this.t + 1;
if(this.t > 1000)
{
beeleave.singleshot("beeleave",true);
clearInterval(_root.beezid);
_root.beezid = setInterval(launchbeez,20020);
this.removeMovieClip();
}
if(this.hitTest(_root.base.char1) || this.hitTest(_level[1]) || this.hitTest(_level[0]))
{
if(!this.sounder)
{
ohno.singleshot("ohno",true);
beesoundz.singleshot("beezzz",true);
this.sounder = true;
}
clearInterval(_root.beezid);
_root.hivez = false;
bee.prototype.enemy = _root.base.char1;
this.beetimer = this.beetimer + 1;
if(this.beetimer > 5 and this.beecount < 7)
{
this.beecount = this.beecount + 1;
this.beetimer = 0;
_root.base.attachMovie("bee","bee",80000 + this.beecount,{_x:this._x,_y:this._y - 20,lifetime:Math.randomBetween(10,30)});
}
}
if(this.hitTest(_root.base.enemy1))
{
if(!this.sounder)
{
ohno.singleshot("ohno",true);
beesoundz.singleshot("beezzz",true);
this.sounder = true;
}
clearInterval(_root.beezid);
_root.hivez = false;
bee.prototype.enemy = _root.base.enemy1;
this.beetimer = this.beetimer + 1;
if(this.beetimer > 5 and this.beecount < 7)
{
this.beecount = this.beecount + 1;
this.beetimer = 0;
_root.base.attachMovie("bee","bee",80000 + this.beecount,{_x:this._x,_y:this._y - 20,lifetime:Math.randomBetween(10,30)});
}
}
};
bee.prototype.onEnterFrame = function()
{
if(this.hitTest(_root.base.char1))
{
if(_root.base.char1.ballooncount > 0)
{
_root.base.char1.ballooncount--;
}
}
if(this._x < this.enemy)
{
this.gotoAndStop("right");
}
else
{
this.gotoAndStop("left");
}
this.k = this.k + 1;
if(this.lifemeter > this.lifetime)
{
this.removeMovieClip();
}
if(this.k > 20)
{
this.lifemeter = this.lifemeter + 1;
this.timer = random(5);
this.k = 0;
}
this.floatTo(0.2,this.movearray[0][this.timer] + this.enemy._x,this.movearray[1][this.timer] + this.enemy._y - 70);
};
bee.prototype.beemove = function()
{
};
MovieClip.prototype.floatTo = function(s, x, y)
{
this._x += Math.round(x - this._x) * s * s;
this._y += Math.round(y - this._y) * s * s;
};
titlemain.looper("bossa");
Object.registerClass("bobletter",bobletter);
bobletter.prototype = new MovieClip();
bobletter.prototype.startbob = function(bobcount, targetz, xpoz, ypoz)
{
b_count = bobcount;
bob_array = ["c","h","a","r","a","c","t","e","r","-","s","e","t","-","u","p"];
b_count = bob_array.length;
targetz.createEmptyMovieClip("holder",5);
bobl = 0;
while(bobl < bob_array.length)
{
boblocy = 60;
boblocx = 60;
targetz.holder.attachMovie("bobletter",[l],bobl + 20,{_y:boblocy,_x:boblocx * bobl / 4,name:bobl,originy:boblocy,stage:1});
targetz.holder._x = -116;
targetz.holder._y = -145;
bobl++;
}
};
bobletter.prototype.onEnterFrame = function()
{
if(!this.init)
{
dir = 1;
counterz = 0;
this.init = true;
}
if(counterz >= b_count)
{
if(tickz > delay)
{
dir = 2;
tickz = 0;
counterz--;
}
else
{
tickz++;
}
}
if(counterz <= -1 and dir == 2)
{
if(tickz > delay)
{
dir = 1;
tick = 0;
counterz = 0;
}
else
{
tickz++;
}
}
if(this.name == counterz and dir == 1)
{
if(this._y < this.originy + 8)
{
this._y += 1 + (this._y - this.originy) / 3;
}
else
{
counterz += 1;
}
}
if(this.name == counterz and dir == 2)
{
if(this._y > this.originy)
{
this._y -= 4;
}
else
{
counterz -= 1;
}
}
};